A file system included in an operating system accesses a storage device of a computing device like a desktop computer, a notebook computer, a smartphone, a tablet PC or others to implement reading, writing and managing a file.
A file system, which has been widely used in recent years, is an extended file system 4 (EXT4). EXT4 is an improved version of the extended file system 3 (EXT3) and provides journaling guaranteeing consistency and continuity. In this case, the journaling is a technique that can restore a file system fast when the system is suddenly terminated due to occurrence of a system failure, a power error or other problems in the computing device. In EXT4, the journaling periodically records a journal log of a storage device in a pre-reserved area of the storage device, i.e., a journal area.
The journaling of EXT4 supports a write-back mode, an ordered mode, and a data mode. The ordered mode journaling is a basic option of the journaling of EXT4. In order to maintain consistency of the file system, the ordered mode journaling records only metadata in the journal area after all data that need to be updated are recorded.
In general, the ordered mode journaling of EXT4 uses a journal thread executed in a background. Thus, the ordered mode journaling has no significant problem even when there is a large volume of data to be stored, and a file having a long response time is stored. However, unlike the conventional ordered mode journaling, an fsync system call does not use the journal thread, and thus, storing a file is not implemented in a background. Therefore, the response time of the journaling may be critical upon the fsync system call.
The fsync system call is one of system call functions of Linux, which is used to be guaranteed as to whether changes in a file designated by a user have been surely recorded in the storage device. In EXT4, the fsync system call records one or more corrected data and their metadata within a transaction in a data area and a journal area of a memory by using the journaling thread. In this case, the transaction is a collection of updates of a file system. That is, the transaction may include corrected data of a file and metadata thereof generated by file calculation after the latest change in a file system. Thus, the transaction may include a file, which is not included in the fsync system call. If there are significant changes in a file, which has not been requested in the fsync system call, the time for implementing the fsync system call may increase.
Below are conventional disclosures to solve the foregoing problems.
Korean Patent Application Publication No. 10-2005-0052016 (entitled: “Method of and Apparatus for Logging and Restoring the Metadata in File System”) describes changing metadata in a transaction unit, and storing logs of the changed metadata in a global log buffer unit. This disclosure identifies whether there has been any change in the metadata stacked in the buffer by using the metadata logs, and stores the change, if any, in a disk.
In addition, Korean Patent Publication No. 10-0453228 (entitled: “Journaling and Recovery Method for Shared Disk File System”) describes identifying whether any change has been made in metadata stacked in a buffer and storing the change, if any, in a storage device.